//
//  MenuItemCell.swift
//  elarc01
//
//  Created by elarc on 2016/11/7.
//  Copyright © 2016年 elarc. All rights reserved.
//

import Foundation

class MenuItemCell: UITableViewCell {
    
    var menuItemImageView:UIImageView!
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        configSubView()
    }
    
    func configSubView() -> Void {
        menuItemImageView = UIImageView()
        menuItemImageView.contentMode = .Center
        menuItemImageView.frame = self.bounds
        self.addSubview(menuItemImageView)
    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
    func configureForMenuItem(menuItem:NSDictionary) {
        menuItemImageView.image = UIImage(named: menuItem["image"] as! String)
        backgroundColor = UIColor.randomColor()
    }
    
}